﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Windows.Controls.Primitives;

namespace MemoBoss
{
    public partial class ScoreloopDialog : UserControl
    {
        public ScoreloopDialog()
        {
            InitializeComponent();
        }
        Action<bool, string, string> Callback;
        //public PopupDialog(Action<bool> callback)
        //    : this()
        //{

        //    Callback = callback;
        //}
        bool DefaultResult = false;
        public ScoreloopDialog(Action<bool, string, string> callback, string login, string email)
            : this()
        {
            txtLogin.Text = login;
            txtEmail.Text = email == null ? "" : email;

            Callback = callback;
        }

        public bool ReturnDefault()
        {
            Callback(DefaultResult, txtLogin.Text, txtEmail.Text);
            return DefaultResult;
        }

        private void btn2_Click(object sender, RoutedEventArgs e)
        {
            Callback(false, txtLogin.Text, txtEmail.Text);
        }

        private void btn1_Click(object sender, RoutedEventArgs e)
        {
            Callback(true, txtLogin.Text, txtEmail.Text);
        }




    }
}
